<div class="header_menu">
    <div class="container">
        <div class="header-nav clearfix">
            <?php echo $this->partial('shop/layout/headerMenu'); ?>
        </div>
    </div>
</div>
</div>
<div class="container breadcrumbs">
    <a href="<?php echo $this->url('shop'); ?>"><?php echo $this->translate('首页'); ?></a>
    <span class="sep">/</span><span><?php echo $this->translate('手机号码'); ?></span>
</div>
<?php
$form = $this->form;
$form->prepare();

$form->setAttributes(['class' => 'form-horizontal']);

$form->get('userPhone')->setAttributes([
    'class' => 'form-control',
    'placeholder' => $this->translate('新手机号码')
]);
?>
<div class="container">
    <div class="uc-full-box">
        <div class="row">
            <div class="span4">
                <?php echo $this->partial('shop/partial/home/leftMenu'); ?>
            </div>
            <div class="span16">
                <div class="xm-line-box uc-box uc-order-detail-box">
                    <div class="box-hd">
                        <h3 class="title">
                            <?php echo $this->translate('手机号码'); ?>
                            &nbsp;&nbsp;
                            <a href="<?php echo $this->url('home-security'); ?>" class="btn btn-default btn-a-url"><?php echo $this->translate('返回'); ?></a>
                        </h3>
                    </div>
                    <div class="box-bd">
                        <?php echo $this->partial('shop/message'); ?>
                        <?php echo $this->form()->openTag($form); ?>
                        <div class="control-group">
                            <label class="control-label"><?php echo $this->translate('原手机号码'); ?>：</label>
                            <div class="controls">
                                <input type="text" class="span3" disabled value="<?php echo $this->escapeHtml($this->userInfo->getUserPhone()); ?>">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"><?php echo $this->translate('手机号码'); ?><span class="must_add_value">*</span>：</label>
                            <div class="controls">
                                <?php if(count($this->phoneArea) == 1) { ?>
                                    <?php echo $this->formElement($form->get('areaCode')); ?>
                                    <?php echo $this->formElementErrors($form->get('areaCode'), ['class'=>'error-message']); ?>
                                    <?php echo $this->formElement($form->get('userPhone')); ?>
                                    <?php echo $this->formElementErrors($form->get('userPhone'), ['class'=>'error-message']); ?>
                                <?php } else {
                                    $form->get('areaCode')->setAttributes(['class' => 'form-control']);
                                    ?>
                                    <?php echo $this->formElement($form->get('areaCode')->setAttributes(['class' => 'span2'])); ?>
                                    <?php echo $this->formElementErrors($form->get('areaCode'), ['class'=>'error-message']); ?>
                                    <?php echo $this->formElement($form->get('userPhone')); ?>
                                    <?php echo $this->formElementErrors($form->get('userPhone'), ['class'=>'error-message']); ?>
                                <?php } ?>
                            </div>
                        </div>
                        <div class="offset3">
                            <button class="btn btn-primary" type="submit"><?php echo $this->translate('提交修改'); ?></button>
                        </div>
                        <?php echo $this->form()->closeTag(); ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $("#<?php echo $form->getName(); ?>").validate({
            rules: {
                userPhone: {
                    required: true
                }
            },
            messages: {
                userPhone: {
                    required: "<?php echo $this->translate('手机号码不能为空!'); ?>"
                }
            }
        });
    });
</script>